package com.carstop.model;

import java.util.List;

public class AreaService {

	private AreaDAO_interface dao;

	public AreaService() {
		dao = new AreaDAO();
	}

	public AreaVO addArea(String area_id, String name) {

		AreaVO areaVO = new AreaVO();

		areaVO.setArea_id(area_id);
		areaVO.setName(name);
		dao.insert(areaVO);

		return areaVO;
	}

	public AreaVO updateEmp(String area_id, String name) {

		AreaVO areaVO = new AreaVO();

		areaVO.setArea_id(area_id);
		areaVO.setName(name);
		dao.update(areaVO);

		return areaVO;
	}

	public void deleteEmp(String area_id) {
		dao.delete(area_id);
	}

	

	public List<AreaVO> getAll() {
		return dao.getAll();
	}
}
